<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MTB CAT1 Peripheral driver library: AC (Autonomous Controller)</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="IFXCYP_one-line.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">MTB CAT1 Peripheral driver library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__group__hppass__ac.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#groups">API Reference</a>  </div>
  <div class="headertitle">
<div class="title">AC (Autonomous Controller)<div class="ingroups"><a class="el" href="group__group__hppass.html">HPPASS       (High Performance Programmable Analog Sub-System)</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<p>This driver provides API functions to configure, manage and interact with the Autonomous Controller (AC) subsystem within High Performance Programmable Analog Sub-System (HPPASS). </p>
<p>The autonomous controller is a programmable finite-state machine (FSM) sequencer that works from a 16-entry state transition table, to transition appropriately through various pre-defined states, based on timer, counter, and/or events. The AC provides hardware control without the need for CPU or external intervention. <br />
 The internal structure and external HW interface of the AC is shown at the picture below.</p>
<div class="image">
<img src="hppass_ac_structure.png" alt="hppass_ac_structure.png" width="30%"/>
</div>
<p>Autonomous controller can perform the following functions:</p><ul>
<li>Enable/disable SAR ADC and/or CSG, provide a BLOCK_READY status to the firmware</li>
<li>Process input hardware/firmware triggers to execute programmed actions</li>
<li>Trigger any of the internal or connected blocks</li>
<li>Implement hardware delays/counters</li>
<li>Perform periodic actions (e.g., triggering) in a timed loop</li>
<li>Receive conditions from the connected blocks and acting on those events</li>
<li>Generate an AC-based interrupt to the CPU</li>
<li>Digital output to as many as five GPIOs</li>
</ul>
<p>The AC has a standard interface to each sub-block of HPPASS, the interface consists of: Enable, Trigger, and Conditions signals groups.</p>
<p>Refer to the Technical Reference Manual for detailed information.</p>
<p>To configure the AC, the driver uses a configuration structure of type <a class="el" href="structcy__stc__hppass__ac__t.html">cy_stc_hppass_ac_t</a> that must be predefined. In turn, this structure holds the non-NULL pointer to the State Transition Table (STT) array of type <a class="el" href="structcy__stc__hppass__ac__stt__t.html">cy_stc_hppass_ac_stt_t</a>. The configuration structure also holds a specialized startup configuration array of type <a class="el" href="structcy__stc__hppass__startup__t.html">cy_stc_hppass_startup_t</a>.<br />
 This array defines the parameters of the AC HW startup.</p>
<h1><a class="anchor" id="group_hppass_ac_stt"></a>
State Transition Table</h1>
<p>The AC can implement a single threaded programming sequence using a simple format. The AC program is stored in a RAM table called a STT, which consists of 16 States (or programming instructions) of type <a class="el" href="structcy__stc__hppass__ac__stt__t.html" title="Configuration structure for one row of the State Transition Table, array of these structures defines ...">cy_stc_hppass_ac_stt_t</a>. These programming instructions can form one or more programs, called by FW, like subroutines.</p>
<dl class="section note"><dt>Note</dt><dd>At least one state (e.g. 'Stop') of the state transition table must be predefined in the STT.</dd>
<dd>
The CSG and/or SAR should be enabled in the first state of the STT to ensure proper working of the AC.</dd></dl>
<p>Here is an example of a simple program coded by STT instructions. </p><div class="fragment"><div class="line"><span class="preprocessor">#define CY_HPPASS_STT_NUM_ENTRIES (4U) </span><span class="comment">/* Define number of states */</span><span class="preprocessor"></span></div><div class="line"></div><div class="line"><span class="keyword">const</span> <a class="code" href="structcy__stc__hppass__ac__stt__t.html">cy_stc_hppass_ac_stt_t</a> stt_cfg[CY_HPPASS_STT_NUM_ENTRIES] =</div><div class="line">{</div><div class="line">    <span class="comment">/* STATE #0: Set P7_0, P7_1 HIGH for ((.count + 1) * clock period) value */</span></div><div class="line">    {</div><div class="line">        .<a class="code" href="structcy__stc__hppass__ac__stt__t.html#a714dcdb2ae8fc839ad952e27a4226618">condition</a>     = <a class="code" href="group__group__hppass__ac__enums.html#ggaea44d893e178654843f93d79240307ffab3aee55dcd80a488a292d97297df4399">CY_HPPASS_CONDITION_CNT_DONE</a>,                <span class="comment">/* Set the condition for moving to the next state */</span></div><div class="line">        .action        = <a class="code" href="group__group__hppass__ac__enums.html#gga9666a32671385b7458ab6884c4b7a1ffaf464c56fbf247e58ffd2b73333c59f37">CY_HPPASS_ACTION_WAIT_FOR</a>,                   <span class="comment">/* Wait in this state until .count = 199 cycles */</span></div><div class="line">        .branchStateIdx   = 0U,                                          <span class="comment">/* Ignored in this state */</span></div><div class="line">        .interrupt     = <span class="keyword">false</span>,</div><div class="line">        .count         = 199U,                                        <span class="comment">/* Set the counter value in cycles */</span></div><div class="line">        .gpioOutUnlock = <span class="keyword">true</span>,                                        <span class="comment">/* Unlock the GPIO Out for AC */</span></div><div class="line">        .gpioOutMsk       = <a class="code" href="group__group__hppass__ac__dout.html#gaa034dbdc77e48346431ef356ac2101cb">CY_HPPASS_GPIO_OUT_0</a> | <a class="code" href="group__group__hppass__ac__dout.html#ga0681cf1d76391bfcb01e94dd81485db1">CY_HPPASS_GPIO_OUT_1</a>, <span class="comment">/* Enable GPIO_OUT0 and GPIO_OUT1 in this state */</span></div><div class="line">        .csgUnlock     = {<span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>},</div><div class="line">        .csgEnable     = {<span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>},</div><div class="line">        .csgDacTrig    = {<span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>},</div><div class="line">        .sarUnlock     = <span class="keyword">false</span>,</div><div class="line">        .sarEnable     = <span class="keyword">false</span>,</div><div class="line">        .sarGrpMsk        = 0U,</div><div class="line">        .sarMux        = {{0}, {0}, {0}, {0}}</div><div class="line">    },</div><div class="line">    <span class="comment">/* STATE #1: Set P7_0 LOW for ((.count + 1) * clock period) value */</span></div><div class="line">    {</div><div class="line">        .condition     = <a class="code" href="group__group__hppass__ac__enums.html#ggaea44d893e178654843f93d79240307ffab3aee55dcd80a488a292d97297df4399">CY_HPPASS_CONDITION_CNT_DONE</a>,       <span class="comment">/* Set the condition for moving to the next state */</span></div><div class="line">        .action        = <a class="code" href="group__group__hppass__ac__enums.html#gga9666a32671385b7458ab6884c4b7a1ffaf464c56fbf247e58ffd2b73333c59f37">CY_HPPASS_ACTION_WAIT_FOR</a>,          <span class="comment">/* Wait in this state until .count = 199 cycles */</span></div><div class="line">        .branchStateIdx   = 0U,                                 <span class="comment">/* Ignored in this state */</span></div><div class="line">        .interrupt     = <span class="keyword">false</span>,</div><div class="line">        .count         = 199U,                               <span class="comment">/* Set the counter value in cycles */</span></div><div class="line">        .gpioOutUnlock = <span class="keyword">true</span>,                               <span class="comment">/* Keep unlock the GPIO Out for AC */</span></div><div class="line">        .gpioOutMsk       = <a class="code" href="group__group__hppass__ac__dout.html#gaa034dbdc77e48346431ef356ac2101cb">CY_HPPASS_GPIO_OUT_0</a>,               <span class="comment">/* GPIO_OUT0 is still Enabled and GPIO_OUT1 becomes disabled */</span></div><div class="line">        .csgUnlock     = {<span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>},</div><div class="line">        .csgEnable     = {<span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>},</div><div class="line">        .csgDacTrig    = {<span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>},</div><div class="line">        .sarUnlock     = <span class="keyword">false</span>,</div><div class="line">        .sarEnable     = <span class="keyword">false</span>,</div><div class="line">        .sarGrpMsk        = 0U,</div><div class="line">        .sarMux        = {{0}, {0}, {0}, {0}}</div><div class="line">    },</div><div class="line">    <span class="comment">/* STATE #2: Set P7_0, P7_1 LOW for ((.count + 1) * clock period) value */</span></div><div class="line">    {</div><div class="line">        .condition     = <a class="code" href="group__group__hppass__ac__enums.html#ggaea44d893e178654843f93d79240307ffab3aee55dcd80a488a292d97297df4399">CY_HPPASS_CONDITION_CNT_DONE</a>,       <span class="comment">/* Set the condition for moving to the next state */</span></div><div class="line">        .action        = <a class="code" href="group__group__hppass__ac__enums.html#gga9666a32671385b7458ab6884c4b7a1ffaf464c56fbf247e58ffd2b73333c59f37">CY_HPPASS_ACTION_WAIT_FOR</a>,          <span class="comment">/* Go to branch state 3 if the condition TRUE */</span></div><div class="line">        .branchStateIdx   = 0U,                                 <span class="comment">/* Ignored in this state */</span></div><div class="line">        .interrupt     = <span class="keyword">false</span>,</div><div class="line">        .count         = 199U,</div><div class="line">        .gpioOutUnlock = <span class="keyword">true</span>,                               <span class="comment">/* Keep unlock the GPIO Out for AC */</span></div><div class="line">        .gpioOutMsk       = MY_HPPASS_GPIO_OUT_DISABLE_ALL,     <span class="comment">/* Disable All HPPASS AC GPIOs in this state*/</span></div><div class="line">        .csgUnlock     = {<span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>},</div><div class="line">        .csgEnable     = {<span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>},</div><div class="line">        .csgDacTrig    = {<span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>},</div><div class="line">        .sarUnlock     = <span class="keyword">false</span>,</div><div class="line">        .sarEnable     = <span class="keyword">false</span>,</div><div class="line">        .sarGrpMsk        = 0U,</div><div class="line">        .sarMux        = {{0}, {0}, {0}, {0}}</div><div class="line">    },</div><div class="line">    <span class="comment">/* STATE #3: Go to the stage 0 */</span></div><div class="line">    {</div><div class="line">        .condition     = <a class="code" href="group__group__hppass__ac__enums.html#ggaea44d893e178654843f93d79240307ffa9abc96bc3ce6522170386c2b22d24657">CY_HPPASS_CONDITION_TRUE</a>,           <span class="comment">/* Set condition TRUE */</span></div><div class="line">        .action        = <a class="code" href="group__group__hppass__ac__enums.html#gga9666a32671385b7458ab6884c4b7a1ffa2d7ae111473625d8f8836418523369ea">CY_HPPASS_ACTION_BRANCH_IF_TRUE</a>,    <span class="comment">/* Go to branch state 0 if condition TRUE */</span></div><div class="line">        .branchStateIdx   = 0U,                                 <span class="comment">/* Set branch state 0 */</span></div><div class="line">        .interrupt     = <span class="keyword">false</span>,</div><div class="line">        .count         = 0U,</div><div class="line">        .gpioOutUnlock = <span class="keyword">false</span>,                              <span class="comment">/* Don&#39;t change the GPIO in this state */</span></div><div class="line">        .gpioOutMsk       = MY_HPPASS_GPIO_OUT_DISABLE_ALL,     <span class="comment">/* This value is ignored here because gpioOutUnlock = false */</span></div><div class="line">        .csgUnlock     = {<span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>},</div><div class="line">        .csgEnable     = {<span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>},</div><div class="line">        .csgDacTrig    = {<span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>},</div><div class="line">        .sarUnlock     = <span class="keyword">false</span>,</div><div class="line">        .sarEnable     = <span class="keyword">false</span>,</div><div class="line">        .sarGrpMsk        = 0U,</div><div class="line">        .sarMux        = {{0}, {0}, {0}, {0}}</div><div class="line">    }</div><div class="line">};</div></div><!-- fragment --> <h1><a class="anchor" id="group_hppass_ac_startup"></a>
Startup</h1>
<p>Startup is initiated by enabling the AC with loaded AC startup sequence instructions (<a class="el" href="structcy__stc__hppass__ac__t.html#a34d50e79c7effc4eb6c3336e400246e1" title="Startup configuration. ">cy_stc_hppass_ac_t::startup</a>). The startup block have dedicated logic to time the HPPASS startup and will generate BLOCK_READY condition once HPPASS startup is done. The application should wait for the BLOCK_READY condition before using any HPPASS features. The BLOCK_READY condition can be checked by <a class="el" href="group__group__hppass__ac__functions.html#gaec00f468edc0706ae7dcb46c86332caa">Cy_HPPASS_AC_IsBlockReady</a> function.</p>
<dl class="section note"><dt>Note</dt><dd>Only usage of the startup parameters recommended by the vendor guarantees the reliable work of the autonomous controller.<br />
 Please use the <b>Device Configurator</b> tool to make configurations or refer to the <b>Technical Reference Manual</b> chapter <b>27.2.1.1</b> for detailed information.</dd></dl>
<h1><a class="anchor" id="group_hppass_ac_code_snippets"></a>
Code Snippets</h1>
<h2><a class="anchor" id="group_hppass_ac_gpio_toggle"></a>
Snippet 1: GPIO Toggling by Autonomous Controller</h2>
<p>An example is shown below, describes a simple case of usage Autonomous Controller for toggling GPIO Out:</p>
<ul>
<li>Configure GPIO pin P7_0 and set HSIOM mode as P7_0_PASS_MCPASS_DOUT0: <div class="fragment"><div class="line"><span class="keyword">const</span> <a class="code" href="structcy__stc__gpio__pin__config__t.html">cy_stc_gpio_pin_config_t</a> TEST_PIN_0_config =</div><div class="line">{</div><div class="line">    .<a class="code" href="structcy__stc__gpio__pin__config__t.html#ae39ff5dc65ffef2808a0183f23691389">outVal</a>    = 1,                        <span class="comment">/* Output = High */</span></div><div class="line">    .driveMode = <a class="code" href="group__group__gpio__drive_modes.html#gacebd8bea6222d742bdfbfd86dabab940">CY_GPIO_DM_STRONG_IN_OFF</a>, <span class="comment">/* Input buffer off */</span></div><div class="line">    .hsiom     = P7_0_PASS_MCPASS_DOUT0,   <span class="comment">/* Set HSIOM MCPASS DOUT0 mode */</span></div><div class="line">    .intEdge   = <a class="code" href="group__group__gpio__interrupt_trigger.html#gae6a68c08c03a67dea6f278c955994c2b">CY_GPIO_INTR_DISABLE</a>,     <span class="comment">/* Disable interrupt */</span></div><div class="line">    .intMask   = 0UL,</div><div class="line">    .vtrip     = <a class="code" href="group__group__gpio__vtrip.html#ga0eb9d3f41338feae28103e8a8c302ba0">CY_GPIO_VTRIP_CMOS</a>,       <span class="comment">/* CMOS voltage trip */</span></div><div class="line">    .slewRate  = <a class="code" href="group__group__gpio__slew_rate.html#gabb43620358101afd1663376cb3ba19b4">CY_GPIO_SLEW_FAST</a>,        <span class="comment">/* Fast slew rate */</span></div><div class="line">    .driveSel  = <a class="code" href="group__group__gpio__drive_strength.html#ga5c4ed339b0e2784557e1f77f120c022c">CY_GPIO_DRIVE_1_2</a>,        <span class="comment">/* Full drive strength */</span></div><div class="line">    .vregEn    = 0UL,                      <span class="comment">/* SIO-specific setting - ignored */</span></div><div class="line">    .ibufMode  = 0UL,                      <span class="comment">/* SIO-specific setting - ignored */</span></div><div class="line">    .vtripSel  = 0UL,                      <span class="comment">/* SIO-specific setting - ignored */</span></div><div class="line">    .vrefSel   = 0UL,                      <span class="comment">/* SIO-specific setting - ignored */</span></div><div class="line">    .vohSel    = 0UL,                      <span class="comment">/* SIO-specific setting - ignored */</span></div><div class="line">    .nonSec    = 0UL                       <span class="comment">/* Secure access */</span></div><div class="line">};</div></div><!-- fragment --></li>
<li>Configure <a class="el" href="structcy__stc__hppass__ac__stt__t.html">cy_stc_hppass_ac_stt_t</a> structure array with appropriate configurations for each state of Autonomous Controller: <div class="fragment"><div class="line"><span class="preprocessor">#define CY_HPPASS_STT_NUM_ENTRIES (4U) </span><span class="comment">/* Define number of states */</span><span class="preprocessor"></span></div><div class="line"></div><div class="line"><span class="keyword">const</span> <a class="code" href="structcy__stc__hppass__ac__stt__t.html">cy_stc_hppass_ac_stt_t</a> stt_cfg[CY_HPPASS_STT_NUM_ENTRIES] =</div><div class="line">{</div><div class="line">    <span class="comment">/* STATE #0: Set P7_0, P7_1 HIGH for ((.count + 1) * clock period) value */</span></div><div class="line">    {</div><div class="line">        .<a class="code" href="structcy__stc__hppass__ac__stt__t.html#a714dcdb2ae8fc839ad952e27a4226618">condition</a>     = <a class="code" href="group__group__hppass__ac__enums.html#ggaea44d893e178654843f93d79240307ffab3aee55dcd80a488a292d97297df4399">CY_HPPASS_CONDITION_CNT_DONE</a>,                <span class="comment">/* Set the condition for moving to the next state */</span></div><div class="line">        .action        = <a class="code" href="group__group__hppass__ac__enums.html#gga9666a32671385b7458ab6884c4b7a1ffaf464c56fbf247e58ffd2b73333c59f37">CY_HPPASS_ACTION_WAIT_FOR</a>,                   <span class="comment">/* Wait in this state until .count = 199 cycles */</span></div><div class="line">        .branchStateIdx   = 0U,                                          <span class="comment">/* Ignored in this state */</span></div><div class="line">        .interrupt     = <span class="keyword">false</span>,</div><div class="line">        .count         = 199U,                                        <span class="comment">/* Set the counter value in cycles */</span></div><div class="line">        .gpioOutUnlock = <span class="keyword">true</span>,                                        <span class="comment">/* Unlock the GPIO Out for AC */</span></div><div class="line">        .gpioOutMsk       = <a class="code" href="group__group__hppass__ac__dout.html#gaa034dbdc77e48346431ef356ac2101cb">CY_HPPASS_GPIO_OUT_0</a> | <a class="code" href="group__group__hppass__ac__dout.html#ga0681cf1d76391bfcb01e94dd81485db1">CY_HPPASS_GPIO_OUT_1</a>, <span class="comment">/* Enable GPIO_OUT0 and GPIO_OUT1 in this state */</span></div><div class="line">        .csgUnlock     = {<span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>},</div><div class="line">        .csgEnable     = {<span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>},</div><div class="line">        .csgDacTrig    = {<span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>},</div><div class="line">        .sarUnlock     = <span class="keyword">false</span>,</div><div class="line">        .sarEnable     = <span class="keyword">false</span>,</div><div class="line">        .sarGrpMsk        = 0U,</div><div class="line">        .sarMux        = {{0}, {0}, {0}, {0}}</div><div class="line">    },</div><div class="line">    <span class="comment">/* STATE #1: Set P7_0 LOW for ((.count + 1) * clock period) value */</span></div><div class="line">    {</div><div class="line">        .condition     = <a class="code" href="group__group__hppass__ac__enums.html#ggaea44d893e178654843f93d79240307ffab3aee55dcd80a488a292d97297df4399">CY_HPPASS_CONDITION_CNT_DONE</a>,       <span class="comment">/* Set the condition for moving to the next state */</span></div><div class="line">        .action        = <a class="code" href="group__group__hppass__ac__enums.html#gga9666a32671385b7458ab6884c4b7a1ffaf464c56fbf247e58ffd2b73333c59f37">CY_HPPASS_ACTION_WAIT_FOR</a>,          <span class="comment">/* Wait in this state until .count = 199 cycles */</span></div><div class="line">        .branchStateIdx   = 0U,                                 <span class="comment">/* Ignored in this state */</span></div><div class="line">        .interrupt     = <span class="keyword">false</span>,</div><div class="line">        .count         = 199U,                               <span class="comment">/* Set the counter value in cycles */</span></div><div class="line">        .gpioOutUnlock = <span class="keyword">true</span>,                               <span class="comment">/* Keep unlock the GPIO Out for AC */</span></div><div class="line">        .gpioOutMsk       = <a class="code" href="group__group__hppass__ac__dout.html#gaa034dbdc77e48346431ef356ac2101cb">CY_HPPASS_GPIO_OUT_0</a>,               <span class="comment">/* GPIO_OUT0 is still Enabled and GPIO_OUT1 becomes disabled */</span></div><div class="line">        .csgUnlock     = {<span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>},</div><div class="line">        .csgEnable     = {<span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>},</div><div class="line">        .csgDacTrig    = {<span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>},</div><div class="line">        .sarUnlock     = <span class="keyword">false</span>,</div><div class="line">        .sarEnable     = <span class="keyword">false</span>,</div><div class="line">        .sarGrpMsk        = 0U,</div><div class="line">        .sarMux        = {{0}, {0}, {0}, {0}}</div><div class="line">    },</div><div class="line">    <span class="comment">/* STATE #2: Set P7_0, P7_1 LOW for ((.count + 1) * clock period) value */</span></div><div class="line">    {</div><div class="line">        .condition     = <a class="code" href="group__group__hppass__ac__enums.html#ggaea44d893e178654843f93d79240307ffab3aee55dcd80a488a292d97297df4399">CY_HPPASS_CONDITION_CNT_DONE</a>,       <span class="comment">/* Set the condition for moving to the next state */</span></div><div class="line">        .action        = <a class="code" href="group__group__hppass__ac__enums.html#gga9666a32671385b7458ab6884c4b7a1ffaf464c56fbf247e58ffd2b73333c59f37">CY_HPPASS_ACTION_WAIT_FOR</a>,          <span class="comment">/* Go to branch state 3 if the condition TRUE */</span></div><div class="line">        .branchStateIdx   = 0U,                                 <span class="comment">/* Ignored in this state */</span></div><div class="line">        .interrupt     = <span class="keyword">false</span>,</div><div class="line">        .count         = 199U,</div><div class="line">        .gpioOutUnlock = <span class="keyword">true</span>,                               <span class="comment">/* Keep unlock the GPIO Out for AC */</span></div><div class="line">        .gpioOutMsk       = MY_HPPASS_GPIO_OUT_DISABLE_ALL,     <span class="comment">/* Disable All HPPASS AC GPIOs in this state*/</span></div><div class="line">        .csgUnlock     = {<span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>},</div><div class="line">        .csgEnable     = {<span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>},</div><div class="line">        .csgDacTrig    = {<span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>},</div><div class="line">        .sarUnlock     = <span class="keyword">false</span>,</div><div class="line">        .sarEnable     = <span class="keyword">false</span>,</div><div class="line">        .sarGrpMsk        = 0U,</div><div class="line">        .sarMux        = {{0}, {0}, {0}, {0}}</div><div class="line">    },</div><div class="line">    <span class="comment">/* STATE #3: Go to the stage 0 */</span></div><div class="line">    {</div><div class="line">        .condition     = <a class="code" href="group__group__hppass__ac__enums.html#ggaea44d893e178654843f93d79240307ffa9abc96bc3ce6522170386c2b22d24657">CY_HPPASS_CONDITION_TRUE</a>,           <span class="comment">/* Set condition TRUE */</span></div><div class="line">        .action        = <a class="code" href="group__group__hppass__ac__enums.html#gga9666a32671385b7458ab6884c4b7a1ffa2d7ae111473625d8f8836418523369ea">CY_HPPASS_ACTION_BRANCH_IF_TRUE</a>,    <span class="comment">/* Go to branch state 0 if condition TRUE */</span></div><div class="line">        .branchStateIdx   = 0U,                                 <span class="comment">/* Set branch state 0 */</span></div><div class="line">        .interrupt     = <span class="keyword">false</span>,</div><div class="line">        .count         = 0U,</div><div class="line">        .gpioOutUnlock = <span class="keyword">false</span>,                              <span class="comment">/* Don&#39;t change the GPIO in this state */</span></div><div class="line">        .gpioOutMsk       = MY_HPPASS_GPIO_OUT_DISABLE_ALL,     <span class="comment">/* This value is ignored here because gpioOutUnlock = false */</span></div><div class="line">        .csgUnlock     = {<span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>},</div><div class="line">        .csgEnable     = {<span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>},</div><div class="line">        .csgDacTrig    = {<span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>},</div><div class="line">        .sarUnlock     = <span class="keyword">false</span>,</div><div class="line">        .sarEnable     = <span class="keyword">false</span>,</div><div class="line">        .sarGrpMsk        = 0U,</div><div class="line">        .sarMux        = {{0}, {0}, {0}, {0}}</div><div class="line">    }</div><div class="line">};</div></div><!-- fragment --></li>
<li>Set HPPASS and AC state transition table configuration, used by <a class="el" href="group__group__hppass__cfg__functions.html#ga8d22889d8dd8c3fd87df1db2869a6956">Cy_HPPASS_Init</a> API: <div class="fragment"><div class="line"><span class="keyword">const</span> <a class="code" href="structcy__stc__hppass__cfg__t.html">cy_stc_hppass_cfg_t</a> hppassCfg =</div><div class="line">{</div><div class="line">    .<a class="code" href="structcy__stc__hppass__cfg__t.html#a3d2448daab68ef8b7c0568a4bc41a695">ac</a> =</div><div class="line">    {</div><div class="line">        .<a class="code" href="structcy__stc__hppass__ac__t.html#a366455c9d80a2dbb04d799ea75c34230">sttEntriesNum</a> = CY_HPPASS_STT_NUM_ENTRIES,                   <span class="comment">/* Set number of states in State Transition Table */</span></div><div class="line">        .stt           = stt_cfg,                                     <span class="comment">/* Set State Transition Table */</span></div><div class="line">        .gpioOutEnMsk   = <a class="code" href="group__group__hppass__ac__dout.html#gaa034dbdc77e48346431ef356ac2101cb">CY_HPPASS_GPIO_OUT_0</a> | <a class="code" href="group__group__hppass__ac__dout.html#ga0681cf1d76391bfcb01e94dd81485db1">CY_HPPASS_GPIO_OUT_1</a>, <span class="comment">/* Enable GPIO Out0, Out1 */</span></div><div class="line">        .startupClkDiv      = 7U,                                          <span class="comment">/* Set Startup Clock Divider */</span></div><div class="line">        .startup       = {{0}, {0}, {0}, {0}}</div><div class="line">    },</div><div class="line">    .vref = CY_HPPASS_VREF_LOCAL,</div><div class="line">    .csg       = NULL,</div><div class="line">    .sar       = NULL,</div><div class="line">    .trigIn    = {{0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}},</div><div class="line">    .trigPulse = {<a class="code" href="group__group__hppass__enums.html#ggae8be0bf60b1685e83512c352328b34cca33dd2eeebd4121262cca802d77172b76">CY_HPPASS_DISABLED</a>, <a class="code" href="group__group__hppass__enums.html#ggae8be0bf60b1685e83512c352328b34cca33dd2eeebd4121262cca802d77172b76">CY_HPPASS_DISABLED</a>, <a class="code" href="group__group__hppass__enums.html#ggae8be0bf60b1685e83512c352328b34cca33dd2eeebd4121262cca802d77172b76">CY_HPPASS_DISABLED</a>, <a class="code" href="group__group__hppass__enums.html#ggae8be0bf60b1685e83512c352328b34cca33dd2eeebd4121262cca802d77172b76">CY_HPPASS_DISABLED</a>,</div><div class="line">                  <a class="code" href="group__group__hppass__enums.html#ggae8be0bf60b1685e83512c352328b34cca33dd2eeebd4121262cca802d77172b76">CY_HPPASS_DISABLED</a>, <a class="code" href="group__group__hppass__enums.html#ggae8be0bf60b1685e83512c352328b34cca33dd2eeebd4121262cca802d77172b76">CY_HPPASS_DISABLED</a>, <a class="code" href="group__group__hppass__enums.html#ggae8be0bf60b1685e83512c352328b34cca33dd2eeebd4121262cca802d77172b76">CY_HPPASS_DISABLED</a>, CY_HPPASS_DISABLED},</div><div class="line">    .trigLevel = {{0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}}</div><div class="line">};</div></div><!-- fragment --></li>
<li>Initialize and start Autonomous Controller: <div class="fragment"><div class="line">    <span class="comment">/* Initialize GPIO P7_0, P7_1 for AC test */</span></div><div class="line">    <a class="code" href="group__group__gpio__functions__init.html#gad61553f65d4e6bd827eb6464a7913461">Cy_GPIO_Pin_Init</a>(GPIO_PRT7, 0U, &amp;TEST_PIN_0_config);</div><div class="line">    <a class="code" href="group__group__gpio__functions__init.html#gad61553f65d4e6bd827eb6464a7913461">Cy_GPIO_Pin_Init</a>(GPIO_PRT7, 1U, &amp;TEST_PIN_1_config);</div><div class="line"></div><div class="line">    <span class="comment">/* Initialize HPPASS */</span></div><div class="line">    <span class="keywordflow">if</span> (CY_HPPASS_SUCCESS != <a class="code" href="group__group__hppass__cfg__functions.html#ga8d22889d8dd8c3fd87df1db2869a6956">Cy_HPPASS_Init</a>(&amp;hppassCfg))</div><div class="line">    {</div><div class="line">        <span class="comment">/* Stop program execution */</span></div><div class="line">        CY_ASSERT(0);</div><div class="line">    }</div></div><!-- fragment --><div class="fragment"><div class="line">    <span class="keywordflow">if</span> (CY_HPPASS_SUCCESS != <a class="code" href="group__group__hppass__ac__functions.html#gabbf381cbbe92e087faf4c89a549cd1d7">Cy_HPPASS_AC_Start</a>(0U, 0U))</div><div class="line">    {</div><div class="line">        <span class="comment">/* Stop program execution */</span></div><div class="line">        CY_ASSERT(0);</div><div class="line">    }</div></div><!-- fragment --></li>
</ul>
<h2><a class="anchor" id="group_hppass_input_trigger"></a>
Snippet 2: The AC state triggering by FW and HW input triggers</h2>
<p>The below example is a simple case of using HPPASS input trigger events to trigger the Autonomous Controller state. The code snippet shows two approaches: FW trigger and HW trigger configurations.</p>
<ul>
<li>Configure the <a class="el" href="structcy__stc__hppass__ac__stt__t.html">cy_stc_hppass_ac_stt_t</a> structure array, where the Autonomous Controller in state #0 waits for a trigger to change that state: <div class="fragment"><div class="line"><span class="preprocessor">#define CY_HPPASS_STT_NUM_ENTRIES (4U) </span><span class="comment">/* Define number of states */</span><span class="preprocessor"></span></div><div class="line"></div><div class="line"><span class="comment">/* Autonomous Controller State Transition Table, describes states and triggering conditions */</span></div><div class="line"><span class="keyword">const</span> <a class="code" href="structcy__stc__hppass__ac__stt__t.html">cy_stc_hppass_ac_stt_t</a> stateTransitionTable[CY_HPPASS_STT_NUM_ENTRIES] =</div><div class="line">{</div><div class="line">    <span class="comment">/* STATE #0: Enable SAR and wait for trigger 0 signal */</span></div><div class="line">    {</div><div class="line">        .<a class="code" href="structcy__stc__hppass__ac__stt__t.html#a714dcdb2ae8fc839ad952e27a4226618">condition</a>     = <a class="code" href="group__group__hppass__ac__enums.html#ggaea44d893e178654843f93d79240307ffa0226a5feda8740a30712a91f2bcece8b">CY_HPPASS_CONDITION_TRIG_0</a>,</div><div class="line">        .action        = <a class="code" href="group__group__hppass__ac__enums.html#gga9666a32671385b7458ab6884c4b7a1ffaf464c56fbf247e58ffd2b73333c59f37">CY_HPPASS_ACTION_WAIT_FOR</a>,</div><div class="line">        .branchStateIdx   = 0U,</div><div class="line">        .interrupt     = <span class="keyword">false</span>,</div><div class="line">        .count         = 0U,</div><div class="line">        .gpioOutUnlock = <span class="keyword">false</span>,</div><div class="line">        .gpioOutMsk       = 0,</div><div class="line">        .csgUnlock     = {<span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>},</div><div class="line">        .csgEnable     = {<span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>},</div><div class="line">        .csgDacTrig    = {<span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>},</div><div class="line">        .sarUnlock     = <span class="keyword">true</span>,</div><div class="line">        .sarEnable     = <span class="keyword">true</span>,</div><div class="line">        .sarGrpMsk        = 0U,</div><div class="line">        .sarMux        = {{0}, {0}, {0}, {0}}</div><div class="line">    },</div><div class="line">    <span class="comment">/* STATE #1: Wait for trigger 0 signal */</span></div><div class="line">    {</div><div class="line">        .condition     = <a class="code" href="group__group__hppass__ac__enums.html#ggaea44d893e178654843f93d79240307ffa0226a5feda8740a30712a91f2bcece8b">CY_HPPASS_CONDITION_TRIG_0</a>,</div><div class="line">        .action        = <a class="code" href="group__group__hppass__ac__enums.html#gga9666a32671385b7458ab6884c4b7a1ffaf464c56fbf247e58ffd2b73333c59f37">CY_HPPASS_ACTION_WAIT_FOR</a>,</div><div class="line">        .branchStateIdx   = 0U,</div><div class="line">        .interrupt     = <span class="keyword">false</span>,</div><div class="line">        .count         = 0U,</div><div class="line">        .gpioOutUnlock = <span class="keyword">false</span>,</div><div class="line">        .gpioOutMsk       = 0,</div><div class="line">        .csgUnlock     = {<span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>},</div><div class="line">        .csgEnable     = {<span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>},</div><div class="line">        .csgDacTrig    = {<span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>},</div><div class="line">        .sarUnlock     = <span class="keyword">false</span>,</div><div class="line">        .sarEnable     = <span class="keyword">false</span>,</div><div class="line">        .sarGrpMsk        = 0U,</div><div class="line">        .sarMux        = {{0}, {0}, {0}, {0}}</div><div class="line">    },</div><div class="line">    <span class="comment">/* STATE #2: Wait for trigger 1 signal */</span></div><div class="line">    {</div><div class="line">        .condition     = <a class="code" href="group__group__hppass__ac__enums.html#ggaea44d893e178654843f93d79240307ffafd9b219078531752c6da7cae50c26950">CY_HPPASS_CONDITION_TRIG_1</a>,</div><div class="line">        .action        = <a class="code" href="group__group__hppass__ac__enums.html#gga9666a32671385b7458ab6884c4b7a1ffaf464c56fbf247e58ffd2b73333c59f37">CY_HPPASS_ACTION_WAIT_FOR</a>,</div><div class="line">        .branchStateIdx   = 0U,</div><div class="line">        .interrupt     = <span class="keyword">false</span>,</div><div class="line">        .count         = 0U,</div><div class="line">        .gpioOutUnlock = <span class="keyword">false</span>,</div><div class="line">        .gpioOutMsk       = 0,</div><div class="line">        .csgUnlock     = {<span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>},</div><div class="line">        .csgEnable     = {<span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>},</div><div class="line">        .csgDacTrig    = {<span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>},</div><div class="line">        .sarUnlock     = <span class="keyword">false</span>,</div><div class="line">        .sarEnable     = <span class="keyword">false</span>,</div><div class="line">        .sarGrpMsk        = 0U,</div><div class="line">        .sarMux        = {{0}, {0}, {0}, {0}}</div><div class="line">    },</div><div class="line">    <span class="comment">/* STATE #3: Stop the Autonomous controller */</span></div><div class="line">    {</div><div class="line">        .condition     = <a class="code" href="group__group__hppass__ac__enums.html#ggaea44d893e178654843f93d79240307ffa9abc96bc3ce6522170386c2b22d24657">CY_HPPASS_CONDITION_TRUE</a>,</div><div class="line">        .action        = <a class="code" href="group__group__hppass__ac__enums.html#gga9666a32671385b7458ab6884c4b7a1ffacd89c6f635b4026c793a6da860350121">CY_HPPASS_ACTION_STOP</a>,</div><div class="line">        .branchStateIdx   = 0U,</div><div class="line">        .interrupt     = <span class="keyword">false</span>,</div><div class="line">        .count         = 0U,</div><div class="line">        .gpioOutUnlock = <span class="keyword">false</span>,</div><div class="line">        .gpioOutMsk       = 0,</div><div class="line">        .csgUnlock     = {<span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>},</div><div class="line">        .csgEnable     = {<span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>},</div><div class="line">        .csgDacTrig    = {<span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>},</div><div class="line">        .sarUnlock     = <span class="keyword">false</span>,</div><div class="line">        .sarEnable     = <span class="keyword">false</span>,</div><div class="line">        .sarGrpMsk        = 0U,</div><div class="line">        .sarMux        = {{0}, {0}, {0}, {0}}</div><div class="line">    }</div><div class="line">};</div><div class="line"></div><div class="line"><span class="comment">/* State transition table configuration, used by Cy_HPPASS_Init API */</span></div><div class="line"><span class="keyword">const</span> <a class="code" href="structcy__stc__hppass__cfg__t.html">cy_stc_hppass_cfg_t</a> hppassCfg =</div><div class="line">{</div><div class="line">    .<a class="code" href="structcy__stc__hppass__cfg__t.html#a3d2448daab68ef8b7c0568a4bc41a695">ac</a> =</div><div class="line">    {</div><div class="line">        .<a class="code" href="structcy__stc__hppass__ac__t.html#a366455c9d80a2dbb04d799ea75c34230">sttEntriesNum</a> = CY_HPPASS_STT_NUM_ENTRIES,</div><div class="line">        .stt = stateTransitionTable,</div><div class="line">        .gpioOutEnMsk = 0U,</div><div class="line">        .startupClkDiv = 7U,</div><div class="line">        .startup = {{0}, {0}, {0}, {0}}</div><div class="line">    },</div><div class="line">    .vref   = CY_HPPASS_VREF_LOCAL,</div><div class="line">    .csg       = NULL,</div><div class="line">    .sar       = NULL,</div><div class="line">    .trigIn    =</div><div class="line">    {   </div><div class="line">        { <span class="comment">/* The input trigger 0 configuration */</span></div><div class="line">            .type = <a class="code" href="group__group__hppass__enums.html#gga7b656d868df34bc35fca9580093fd86ba311e3a4fc167b73d41efe4e90cf33461">CY_HPPASS_TR_FW_PULSE</a>,</div><div class="line">            .hwMode = <a class="code" href="group__group__hppass__enums.html#gga1eb8a212c86efb9c4721cfb545fb026da7fdb7edee7230eb692a8c318096f2f0e">CY_HPPASS_PULSE_ON_BOTH_SINGLE_SYNC</a></div><div class="line">        },</div><div class="line">        { <span class="comment">/* The input trigger 1 configuration */</span></div><div class="line">            .type = <a class="code" href="group__group__hppass__enums.html#gga7b656d868df34bc35fca9580093fd86ba627775e62c6b1251281d53404a324121">CY_HPPASS_TR_HW_B</a>,</div><div class="line">            .hwMode = <a class="code" href="group__group__hppass__enums.html#gga1eb8a212c86efb9c4721cfb545fb026da7fdb7edee7230eb692a8c318096f2f0e">CY_HPPASS_PULSE_ON_BOTH_SINGLE_SYNC</a></div><div class="line">        },</div><div class="line">        {0}, {0}, {0}, {0}, {0}, {0}</div><div class="line">    },</div><div class="line">    .trigPulse = {<a class="code" href="group__group__hppass__enums.html#ggae8be0bf60b1685e83512c352328b34cca33dd2eeebd4121262cca802d77172b76">CY_HPPASS_DISABLED</a>, <a class="code" href="group__group__hppass__enums.html#ggae8be0bf60b1685e83512c352328b34cca33dd2eeebd4121262cca802d77172b76">CY_HPPASS_DISABLED</a>, <a class="code" href="group__group__hppass__enums.html#ggae8be0bf60b1685e83512c352328b34cca33dd2eeebd4121262cca802d77172b76">CY_HPPASS_DISABLED</a>, <a class="code" href="group__group__hppass__enums.html#ggae8be0bf60b1685e83512c352328b34cca33dd2eeebd4121262cca802d77172b76">CY_HPPASS_DISABLED</a>,</div><div class="line">                  <a class="code" href="group__group__hppass__enums.html#ggae8be0bf60b1685e83512c352328b34cca33dd2eeebd4121262cca802d77172b76">CY_HPPASS_DISABLED</a>, <a class="code" href="group__group__hppass__enums.html#ggae8be0bf60b1685e83512c352328b34cca33dd2eeebd4121262cca802d77172b76">CY_HPPASS_DISABLED</a>, <a class="code" href="group__group__hppass__enums.html#ggae8be0bf60b1685e83512c352328b34cca33dd2eeebd4121262cca802d77172b76">CY_HPPASS_DISABLED</a>, CY_HPPASS_DISABLED},</div><div class="line">    .trigLevel = {{0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}}</div><div class="line">};</div></div><!-- fragment --> <b>Initialization of the hardware modules for the AC with input triggers:</b> <div class="fragment"><div class="line">    <a class="code" href="group__group__sysclk__clk__peripheral__funcs.html#ga2f480c53ecec720ceed823b2692f1698">Cy_SysClk_PeriphAssignDivider</a>(PCLK_TCPWM0_CLOCK_COUNTER_EN3, <a class="code" href="group__group__sysclk__clk__peripheral__enums.html#gga06138349be16d91fd5d00ded2f4592b8ad2299deae6e36a070de5a60368b319ad">CY_SYSCLK_DIV_8_BIT</a>, 0U);</div><div class="line">    tcpwmStatus = <a class="code" href="group__group__tcpwm__functions__counter.html#ga6068a06ddc8a07c67bb6df86e920944c">Cy_TCPWM_Counter_Init</a>(TCPWM0, TCPWM_CNT_NUM, &amp;tcpwmCfg);</div><div class="line">    printf(<span class="stringliteral">&quot;Cy_TCPWM_Counter_Init status: %s\r\n&quot;</span>, ((tcpwmStatus == 0) ? <span class="stringliteral">&quot;SUCCESS&quot;</span> : <span class="stringliteral">&quot;FAIL&quot;</span>));</div><div class="line">    <a class="code" href="group__group__tcpwm__functions__counter.html#ga1707e2cc291fe486fbea346157c65bff">Cy_TCPWM_Counter_Enable</a>(TCPWM0, TCPWM_CNT_NUM);</div><div class="line"></div><div class="line">    trigmuxStatus = <a class="code" href="group__group__trigmux__functions.html#gab7106b8fe037e2ebbbb996289ad1fb00">Cy_TrigMux_Select</a>(TRIG_OUT_1TO1_2_TCPWM0_GRP0_CNT3_OUT1_TO_MCPASS_TR_IN1, 0, TRIGGER_TYPE_EDGE);</div><div class="line">    printf(<span class="stringliteral">&quot;Cy_TrigMux_Select status: %s\r\n&quot;</span>, ((trigmuxStatus == 0) ? <span class="stringliteral">&quot;SUCCESS&quot;</span> : <span class="stringliteral">&quot;FAIL&quot;</span>));</div><div class="line"></div><div class="line">    hppassStatus = <a class="code" href="group__group__hppass__cfg__functions.html#ga8d22889d8dd8c3fd87df1db2869a6956">Cy_HPPASS_Init</a>(&amp;hppassCfg);</div><div class="line">    printf(<span class="stringliteral">&quot;Cy_HPPASS_Init status: %s\r\n&quot;</span>, ((hppassStatus == 0) ? <span class="stringliteral">&quot;SUCCESS&quot;</span> : <span class="stringliteral">&quot;FAIL&quot;</span>));</div><div class="line"></div><div class="line">    hppassACStatus = <a class="code" href="group__group__hppass__ac__functions.html#gabbf381cbbe92e087faf4c89a549cd1d7">Cy_HPPASS_AC_Start</a>(0U, 0U); <span class="comment">/* Start Autonomous Controller */</span></div><div class="line">    printf(<span class="stringliteral">&quot;Cy_HPPASS_AC_Start status: %s\r\n&quot;</span>, ((hppassACStatus == 0) ? <span class="stringliteral">&quot;SUCCESS&quot;</span> : <span class="stringliteral">&quot;FAIL&quot;</span>));</div><div class="line">    __enable_irq();</div><div class="line"></div><div class="line">    hppassACStatus = <a class="code" href="group__group__hppass__ac__functions.html#gafe3a52cfc422239331c798f8b992ee19">Cy_HPPASS_AC_GetState</a>(&amp;hppassState);</div><div class="line">    printf(<span class="stringliteral">&quot;\nAC state: %s, STT pointer = %d, Ready to testing\r\n&quot;</span>, ((hppassState.ac.running == 0) ? <span class="stringliteral">&quot;STOPPED&quot;</span> : <span class="stringliteral">&quot;RUNNING&quot;</span>), hppassState.ac.stateIdx);</div></div><!-- fragment --> <b>Triggering HPPASS Autonomous Controller state by FW trigger:</b> <div class="fragment"><div class="line">    <span class="keywordflow">for</span>(uint8_t i=1; i&lt;=2; i++)</div><div class="line">    {</div><div class="line">        printf(<span class="stringliteral">&quot;--- Start FW Trigger test ---\r\n&quot;</span>);</div><div class="line">        <a class="code" href="group__group__hppass__rt__functions.html#ga18367310dbde8b68347e112512dff9b0">Cy_HPPASS_SetFwTrigger</a>(<a class="code" href="group__group__hppass__triggers__masks.html#gacffb19be53f1e17596d28406061d88f8">CY_HPPASS_TRIG_0_MSK</a>); <span class="comment">/* Set firmware trigger */</span></div><div class="line"></div><div class="line">        <a class="code" href="group__group__syslib__functions.html#gaad1c32546fdb0e3c6fa8b46fb95843b5">Cy_SysLib_Delay</a>(100);</div><div class="line"></div><div class="line">        hppassACStatus = <a class="code" href="group__group__hppass__ac__functions.html#gafe3a52cfc422239331c798f8b992ee19">Cy_HPPASS_AC_GetState</a>(&amp;hppassState); <span class="comment">/*Get and print AC state*/</span></div><div class="line">        printf(<span class="stringliteral">&quot;AC state: %s, STT pointer = %d, &quot;</span>, ((hppassState.ac.running == 0) ? <span class="stringliteral">&quot;STOPPED&quot;</span> : <span class="stringliteral">&quot;RUNNING&quot;</span>), hppassState.ac.stateIdx);</div><div class="line">        printf(<span class="stringliteral">&quot;The test: %s\r\n&quot;</span>, (((hppassState.ac.running == 1) &amp;&amp; (hppassState.ac.stateIdx == i)) ? <span class="stringliteral">&quot;PASSED&quot;</span> : <span class="stringliteral">&quot;FAILED&quot;</span>));</div><div class="line">    }</div></div><!-- fragment --> <b>Triggering HPPASS Autonomous Controller state by HW trigger:</b> <div class="fragment"><div class="line">    printf(<span class="stringliteral">&quot;--- Start HW Trigger test ---\r\n&quot;</span>);</div><div class="line">    <a class="code" href="group__group__tcpwm__functions__common.html#gaafe86ec440bec9a2c23392f289cc3a8b">Cy_TCPWM_TriggerStart_Single</a>(TCPWM0, TCPWM_CNT_NUM); <span class="comment">/* Software start on the TCPWM0*/</span></div><div class="line"></div><div class="line">    <a class="code" href="group__group__syslib__functions.html#gaad1c32546fdb0e3c6fa8b46fb95843b5">Cy_SysLib_Delay</a>(500);</div><div class="line"></div><div class="line">    hppassACStatus = <a class="code" href="group__group__hppass__ac__functions.html#gafe3a52cfc422239331c798f8b992ee19">Cy_HPPASS_AC_GetState</a>(&amp;hppassState); <span class="comment">/*Get and print AC state*/</span></div><div class="line">    printf(<span class="stringliteral">&quot;AC state: %s, STT pointer = %d, &quot;</span>, ((hppassState.ac.running == 0) ? <span class="stringliteral">&quot;STOPPED&quot;</span> : <span class="stringliteral">&quot;RUNNING&quot;</span>), hppassState.ac.stateIdx);</div><div class="line">    printf(<span class="stringliteral">&quot;The test: %s\r\n&quot;</span>, (((hppassState.ac.running == 0) &amp;&amp; (hppassState.ac.stateIdx == 3)) ? <span class="stringliteral">&quot;PASSED&quot;</span> : <span class="stringliteral">&quot;FAILED&quot;</span>));</div></div><!-- fragment --></li>
</ul>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="groups"></a>
API Reference</h2></td></tr>
<tr class="memitem:group__group__hppass__ac__macros"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hppass__ac__macros.html">Macros</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:group__group__hppass__ac__functions"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hppass__ac__functions.html">Functions</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:group__group__hppass__ac__data__structures"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hppass__ac__data__structures.html">Data Structures</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:group__group__hppass__ac__enums"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hppass__ac__enums.html">Enumerated Types</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>MTB CAT1 Peripheral driver library</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
